<include file="substation/public@header" />
<style>
	.trade_item_list{
		display: -webkit-flex; /* Safari */
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.trade_item_list .trade_item{
		flex: 1;
	}
	.trade_item_v{
		font-size: 16px;
		font-weight: bold;
	}
	.js_tips{
		margin-left: 10px;
	}
</style>
</head>
<body>
<div class="layui-fluid">
	<div class="layui-row">
		<div class="layui-page-header">
            <div class="layui-card">
                <div class="layui-page-header-content">
                    <div class="layui-card-body">
                        <div class="layui-ui-page-header-title" >
                            查看明细<!--<span class="layui-badge-rim page-content">系统订单</span>-->
                        </div>
                    </div>

					<div class="layui-tab layui-tab-brief">
						<ul class="layui-tab-title" id="tabHeader">
							<li ><a href="javascript:history.back();">返回</a></li>
							<li class="layui-this"><a>列表</a></li>

						</ul>
					</div>
                </div>
            </div>
        </div>

		<div class="layui-page-content">
			<div class="layui-card">
				<div class="layui-card-body">
					<form class="layui-form" method="post" action="{:url('statistical/index2')}">
						<div class="layui-form-item">
							<div class="layui-inline">
								<div class="layui-input-inline">
									<select class="layui-input" name="type">
										<option value="">全部类型</option>
										<volist name="type" id="v">
											<option value="{$key}" <if condition="input('request.type') neq '' && input('request.type') eq $key">selected</if>>{$v}</option>
										</volist>
									</select>
								</div>
							</div>

							<div class="layui-inline">
								<div class="layui-input-inline">
									<select class="layui-input" name="income">
										<option value="">全部状态</option>
										<volist name="income" id="v">
											<option value="{$key}" <if condition="input('request.income') neq '' && input('request.income') eq $key">selected</if>>{$v}</option>
										</volist>
									</select>
								</div>
							</div>

							<div class="layui-inline">
								<div class="layui-input-inline">
									<input type="text" class="layui-input js-bootstrap-date" name="start_time"
										   value="{:input('request.start_time')}"
										   autocomplete="off" placeholder="开始日期">
								</div>
								<div class="layui-form-mid">-</div>
								<div class="layui-input-inline">
									<input type="text" class="layui-input js-bootstrap-date" name="end_time"
										   value="{:input('request.end_time')}"
										   autocomplete="off" placeholder="结束日期">
								</div>
							</div>
		
		
							<!--<div class="layui-inline">
								<div class="layui-input-inline">
									<input type="text" class="layui-input" name="uid" value="{:input('request.uid')}" placeholder="请输入用户ID">
								</div>
							</div>-->
		
							<div class="layui-inline">
								<div class="layui-input-inline">
									<input type="text" class="layui-input" name="keyword" value="{:input('request.keyword')}" placeholder="请输入关键字">
								</div>
							</div>
		
							<div class="layui-inline">
								<div class="layui-input-inline">
									<input type="submit" class="layui-btn btn-primary" value="搜索" />
									<a class="layui-btn layui-btn-danger btn-danger" href="{:url('statistical/index2')}">清空</a>
								</div>
							</div>
						</div>
						
					</form>
				</div>

				<div class="layui-card-body">
					<div class="layui-row">
						<div class="layui-col-md12">
							<div class="layui-card">
								<div class="layui-card-header">交易汇总</div>
								<div class="layui-card-body">
									<div class="trade_item_list">
										<div class="trade_item">
											<div class="trade_item_t">
												支付配送总金额(元)
												<span class="layui-icon layui-icon-tips js_tips" data-tip="统计时间内支付的订单，与配送相关的费用，包含小费"></span>
											</div>
											<div class="trade_item_v">
												{$total}
											</div>
										</div>

										<div class="trade_item">
											<div class="trade_item_t">
												已结算(元)
												<span class="layui-icon layui-icon-tips js_tips" data-tip="统计时间内支付的订单，已结算的配送金额"></span>
											</div>
											<div class="trade_item_v">
												{$ok}
											</div>
										</div>

										<div class="trade_item">
											<div class="trade_item_t">
												待结算(元)
												<span class="layui-icon layui-icon-tips js_tips" data-tip="统计时间内支付的订单，已支付未结算的配送金额"></span>
											</div>
											<div class="trade_item_v">
												{$no}
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>

				</div>

				<div class="layui-card-body"></div>
			</div>
		</div>

	
		<div class="layui-page-content">
			<div class="layui-card">
				<div class="layui-card-body">
					<table class="layui-table" lay-even lay-size="lg">
						<thead>
						<tr>
							<th>ID</th>
							<th>类型</th>
							<th>状态</th>
							<th>订单号</th>
							<th>总价</th>
							<th>分站收入</th>
							<th>骑手收入</th>
							<th>骑手</th>

							<th>提交时间</th>
							<th>{:lang('ACTIONS')}</th>
						</tr>
						</thead>
						<tbody>
						<foreach name="lists" item="vo">
							<tr>
								<td>{$vo.id}</td>
								<td>{$type[$vo['type']]}</td>
								<td>{$income[$vo['isincome']]}</td>
								<td>{$vo['orderno']}</td>
								<td>{$vo['money_total']}</td>
								<td>{$vo['substation_income']}</td>
								<td>{$vo['rider_income']}</td>
								<td>
									{$vo['riderinfo']['user_nickname']} ({$vo['riderid']})
								</td>

								<td>{:date('Y-m-d H:i:s',$vo['addtime'])}</td>

								<td>
									<a class="layui-bo layui-bo-small layui-bo-succes" href="javascript:admin.openIframeDialog('{:url('trade/detail',['id'=>$vo['id']])}','明细',{area:['700px','500px'],btn:[]});">明细</a>
								</td>
							</tr>
						</foreach>
						</tbody>
					</table>
					<div class="pagination">{$page}</div>
				</div>
			</div>
		</div>
	</div>


</div>
<include file="substation/public@script"/>
<script>
	(function (){
		$('.js_tips').mouseover(function (){
			let _that=$(this);
			let tip=_that.data('tip');
			layer.tips(tip, _that);
		})
	})()
</script>
</body>
</html>